package com.learnJava.demo;

public class SilverCard extends Card {

    public SilverCard(String cardId, String name, String phone, double money) {
        super(cardId, name, phone, money);
    }

    @Override
    public void consume(double money) {
        System.out.println("您当前的消费金额为：" + money);
        if(money * 0.9 > getMoney()) {
            System.out.println("您的余额为：" + getMoney() + "，当前余额不足！");
            return;
        }
        System.out.println("优惠后实际支付金额为：" + money * 0.9);
        setMoney(getMoney() - money * 0.9);
    }
}